package com.project.purchase.Service.Imp;

import com.project.purchase.Service.IProducer;
import com.project.purchase.entity.Producer;
import com.project.purchase.mapper.ProducerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author VX5
 * @Title: QZP
 * @ProjectName purchase
 * @Description: TODO
 * @date ${DAT}20:23
 */
@Service
public class ProducerImp implements IProducer {
    @Autowired
    ProducerMapper producerMapper;

    @Override
    public void delet(String id) {
        producerMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<Producer> getAllPro() {
        return producerMapper.selectAll();
    }

    @Override
    public List<Producer> GetByName(String name) {
        return producerMapper.GetByName(name);
    }

    @Override
    public void addPro(Producer producer) {
        producerMapper.insertSelective(producer);
    }

    @Override
    public void updatePro(Producer producer) {
        producerMapper.updateByPrimaryKeySelective(producer);
    }

    @Override
    public String GetProIDByName(String name) {
        return producerMapper.GetProIDByName(name);
    }

    @Override
    public String GetProIDByLoginName(String name) {
        return producerMapper.GetProIDByLoginName(name);
    }
}
